# Create your views here.
from risk.models import *
from risk.serializers import *
from dvadmin.utils.viewset import CustomModelViewSet


class BuhegehouchuliGuoshengshichouViewSet(CustomModelViewSet):
    """
    list:查询
    create:新增
    update:修改
    retrieve:单例
    destroy:删除
    """
    queryset = BuhegehouchuliGuoshengshichou.objects.all()
    serializer_class = BuhegehouchuliGuoshengshichouSerializer
    create_serializer_class = BuhegehouchuliGuoshengshichouCreateUpdateSerializer
    update_serializer_class = BuhegehouchuliGuoshengshichouCreateUpdateSerializer
    filter_fields = ["统计年份", "辖区"]
    search_fields = ["统计年份", "辖区"]
